// components/routelist/index.js
import {
    baseUrl
} from "../../api/request";
Component({
    properties: {
        list: {
            type: Array,
            value: [],
            observer: function (val) {
                console.log('val',val);
                this.setData({
                    route: val
                });
            }
        },
    },

    data: {
        //图片地址
        baseUrl: baseUrl,
        route: []
    },
    methods: {
        listClick(e) {
            let {
                index
            } = e.currentTarget.dataset;
            this.triggerEvent('listClick', index)
        },
        showVillage(e) {
            let {
                index
            } = e.currentTarget.dataset;
            this.data.route[index].show = !this.data.route[index].show
            this.setData({
                route: this.data.route
            })
        },
    }
})